<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>Document</title>
		<style>
			#app {
				width: 300px;
				height: 300px;
				background: green;
			}

			#wrap {
				width: 100px;
				height: 100px;
				background: pink;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<div id="wrap">wrap</div>
		</div>

		<script>
			// document.getElementById('app').onclick = function() {}

			document.getElementById('app').addEventListener('click', (e) => {
				console.log('app');
				// e.stopImmediatePropagation()
				e.stopPropagation()
			}, true)

			document.getElementById('wrap').addEventListener('click', (e) => {
				console.log('wrap');
				// e.stopPropagation()  // 阻止事件传播
				// e.stopImmediatePropagation()  // 阻止默认事件
			}, true)
		</script>
	</body>
</html>
